import request from '@/utils/request'

var baseUrl = '/order'

export function getById(id) {
  return request({
    url: baseUrl + '/get-by-id',
    method: 'get',
    params: { id }
  })
}

export function fetchList(query) {
  return request({
    url: baseUrl + '/get-list-page',
    method: 'post',
    data: query
  })
}

export function createOrder(data) {
  return request({
    url: baseUrl + '/save',
    method: 'post',
    data
  })
}

export function updateOrder(data) {
  return request({
    url: baseUrl + '/update',
    method: 'post',
    data
  })
}

export function deleteOneOrder(id) {
  return request({
    url: baseUrl + '/delete-one',
    method: 'get',
    params: { id }
  })
}

